/* DO-FILE, JAN 2023

"The influence of expert groups: a citation analysis"

Accepted for publication in JEPP January 2023

Author details:
Johan Christensen (corresponding author)
Leiden University, Institute of Public Administration
j.christensen@fgga.leidenuniv.nl
PO Box 13228, 2501 EE The Hague, The Netherlands
ORCID: 0000-0002-2582-7827

Stine Hesstvedt
Norwegian Institute for Social Research
stine.hesstvedt@samfunnsforskning.no
Postboks 3233 Elisenberg, 0208 Oslo, Norway
ORCID: 0000-0001-5566-2720

*/

set scheme plotplain, perm
cd "~\citation analysis\Data\Datasets"


/* FIGURE 2. *******************************************************************
Composition. */
use "citedreport_full_2.dta", replace
gen perc_civpub=perc_pubempl+perc_civil

collapse perc_aca perc_polit perc_business perc_civil perc_pubempl perc_civpub, by(com_yearsubmiss)

graph twoway ///
(lowess perc_aca com_yearsubmiss) ///
(lowess perc_polit com_yearsubmiss) ///
(lowess perc_business com_yearsubmiss) ///
(lowess perc_civpub com_yearsubmiss), ///
legend(pos(4) row(5) order(1 "Academics" 2 "Politicians" 3 "Interest groups and business" 4 "Civil servants and public employees")) ///
xtitle("") /// 
title("") ///
ytitle("Annual share") ylab(,nogrid) xlab(1970(8)2018,nogrid)
graph export "~\citation analysis\Figures and tables\finalsub\figure2.tif", replace
graph export "~\citation analysis\Figures and tables\finalsub\figure2.eps", replace



/* FIGURE 7. *******************************************************************
* Citations in white papers (panel A) and commission reports (panel B) of academic commissions
(at least one academic – solid lines) and non-academic commission (no academic members – dotted lines). 
Average number of citations per commission, per year of commission report submission. Lowess trend lines. */
use "citedreport_full_2.dta", replace
drop acacite_d
gen totcite_x = totcite if d_aca==0
gen acacite_d = totcite if d_aca==1
collapse  totcite_x acacite_d, by(com_yearsubmiss)
graph twoway (lowess acacite_d com_yearsubmiss) (scatter acacite_d com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(black%50)) ///
(lowess totcite_x com_yearsubmiss) (scatter totcite_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50) ) , ///
legend(order (1 "Academic commissions (trend line)" 2 "Annual average" 3 "Non-academic commissions" 4 "Annual average") ///
row(3) col(2) position(6) region(lcolor(white))) ///
title("B: Policy advisory reports") /// 
xtitle("") ///
ytitle("Number of citations") ylab(, nogrid) scheme(plotplain) xlab(1970(8)2018,nogrid)
graph save "graph1.gph", replace

use "citedreports_nou_stm_1998.dta", replace
tab stm_cit
gen acacite_stm = stm_cit if d_aca==1
gen stm_cit_x = stm_cit if d_aca==0
collapse stm_cit_x acacite_stm, by(com_yearsubmiss)
graph twoway (lowess acacite_stm com_yearsubmiss) (scatter acacite_stm com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(black%50)) ///
(lowess stm_cit_x com_yearsubmiss) (scatter stm_cit_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50) ) , ///
legend(order (1 "Academic commissions (trend line)" 2 "Annual average" 3 "Non-academic commissions" 4 "Annual average") ///
row(3) col(2) position(6) region(lcolor(white))) ///
xtitle("") title("A: White papers") /// 
ytitle("Number of citations") ylab(, nogrid) scheme(plotplain) xlab(1998(5)2018,nogrid)
graph save "graph2.gph", replace

graph combine graph2.gph graph1.gph
graph export  "~\citation analysis\Figures and tables\finalsub\figure7.eps", replace
graph export  "~\citation analysis\Figures and tables\finalsub\figure7.tif", replace


/* FIGURE 8. *******************************************************************
* Citations in white papers (panel A) and commission reports (panel B) of political commissions
(at least one politician – solid lines) and non-political commission (no politicians – dotted lines). 
Average number of citations per commission, per year of commission report submission. Lowess trend lines. */
use "citedreport_full_2.dta", replace
drop acacite_d
gen totcite_x = totcite if d_polit==0
gen politcite_d = totcite if d_polit==1
collapse  totcite_x politcite_d, by(com_yearsubmiss)
graph twoway (lowess politcite_d com_yearsubmiss) (scatter politcite_d com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(black%50)) ///
(lowess totcite_x com_yearsubmiss) (scatter totcite_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50) ) , ///
legend(order (1 "Political members (trend line)" 2 "Annual average" 3 "No political members" 4 "Annual average") ///
row(3) col(2) position(6) region(lcolor(white))) ///
title("B: Policy advisory reports") /// 
xtitle("") ///
ytitle("Number of citations") ylab(, nogrid) scheme(plotplain) xlab(1970(8)2018,nogrid)
graph save "graph1b.gph", replace


use "citedreports_nou_stm_1998.dta", replace
tab stm_cit
gen politcite_stm = stm_cit if d_polit==1
gen stm_cit_x = stm_cit if d_polit==0
collapse stm_cit_x politcite_stm, by(com_yearsubmiss)
graph twoway (lowess politcite_stm com_yearsubmiss) (scatter politcite_stm com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(black%50)) ///
(lowess stm_cit_x com_yearsubmiss) (scatter stm_cit_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50) ) , ///
legend(order (1 "Political members (trend line)" 2 "Annual average" 3 "No political members" 4 "Annual average")  ///
row(3) col(2) position(6) region(lcolor(white))) ///
xtitle("") title("A: White papers") /// 
ytitle("Number of citations") ylab(, nogrid) scheme(plotplain) xlab(1998(5)2018,nogrid)
graph save "graph2b.gph", replace

graph combine graph2b.gph graph1b.gph
graph export "~\citation analysis\Figures and tables\finalsub\figure8.eps", replace
graph export "~\citation analysis\Figures and tables\finalsub\figure8.tif", replace



/* FIGURE 9. *******************************************************************
Regression tables and coefficient plots.
Based on regression results using NOU dv and White paper DV. */

use "citedreport_full_2.dta", replace

* NOU DV
* Summary and correlation tables
sum totcite perc_aca perc_business perc_polit fin date_count num_sec 
corr totcite perc_aca perc_business perc_polit fin date_count num_sec 

*Regressions
menbreg totcite  perc_aca perc_business perc_polit  || ya:
estimates store m1_tot

menbreg totcite  perc_aca perc_business perc_polit  || ya:
estimates store m1_tot

menbreg totcite  fin|| ya:
estimates store m2_tot

menbreg totcite  num_sec date_count || ya:
estimates store m3_tot

menbreg totcite  perc_aca perc_business  perc_polit  fin  num_sec date_count  || ya:
estimates store m4_tot

menbreg totcite  perc_aca perc_business perc_polit  fin num_sec date_count com_lovutvalg com_kr com_multiplereports  || ya:
estimates store m5_tot


*WHITE PAPERS DV
use "citedreports_nou_stm_1998.dta", replace

* Summary and correlation tables
sum stm_cit perc_aca perc_business perc_polit fin date_count num_sec 
corr stm_cit perc_aca perc_business perc_polit fin date_count num_sec 

*Regressions
menbreg stm_cit  perc_aca  perc_business perc_polit  || ya:
estimates store m1_stm

menbreg stm_cit  c.fin  || ya:
estimates store m2_stm

menbreg stm_cit  num_sec date_count || ya:
estimates store m3_stm

menbreg stm_cit  perc_aca perc_business perc_polit  fin num_sec date_count  || ya:
estimates store m4_stm

menbreg stm_cit  perc_aca perc_business perc_polit  fin num_sec date_count com_lovutvalg com_kr com_multiplereports  || ya:
estimates store m5_stm


*COEFPLOT AND TABLES FOR APPENDIX
label variable perc_aca "Academics, share"
label variable perc_civil "Civil servants, share"
label variable perc_ig "Interest groups, share"
label variable perc_pubempl "Public employee, share"
label variable perc_business "Interest groups and business"
label variable perc_polit "Politicians, share"
label variable perc_priv "Private employee, share"
label variable fin "Ministry of Finance"
label variable asd "Ministry of Labor"
label variable jus "Ministry of Law"
label variable num_sec "Secretaries"
label variable com_multiplereports "Multiple reports"
label variable date_count "Time"
label variable com_kr "Appointed by royal decree"
label variable com_lovutvalg "Law proposal"



/* Tables
esttab m1_tot m2_tot m3_tot m4_tot m5_tot using ///
"~\citation analysis\Figures and tables\finalsub\models_totcite.rtf", ///
label nogaps r2 se star(* 0.05 ** 0.01 *** 0.001) stats(N) b(3) scalars(chibar2)  replace

esttab m1_stm m2_stm m3_stm m4_stm m5_stm using ///
"~\citation analysis\Figures and tables\finalsub\models_stmcite.rtf", ///
label nogaps r2 se star(* 0.05 ** 0.01 *** 0.001) stats(N) b(3) scalars(chibar2)  replace
*/

*Coeficient plots
coefplot m5_stm, bylabel(White papers) ///
|| m5_tot, bylabel(Policy advisory reports) ///
 ||, xlab(-2(1)3) drop(_cons) xline(0) scheme(plottig) legend(pos(6) row(1))
 graph save coefplot5.gph, replace
graph export  "~\citation analysis\Figures and tables\finalsub\figure9.tif", replace
graph export  "~\citation analysis\Figures and tables\finalsub\figure9.eps", replace





* APPENDIX *********************************************************************

*Figure A1: NOUs over time
use "citedreport_full_2.dta", replace
gen freq=1
collapse (sum) freq, by(com_yearsubmiss)

graph twoway  ///
(scatter freq com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess freq com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("") ///
ytitle("Number of NOUs") scheme(plotplain) xlab(1972(5)2018,nogrid)
graph save graphh.gph, replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A1.eps", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A1.tif", replace

*Figure A2: Histogram DV1
use "citedreports_nou_stm_1998.dta", replace
twoway hist stm_cit, frequency xtitle("White paper citations")
graph save graph000.gph, replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A2.eps", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A2.tif", replace


*Figure A3: Histogram DV2
use "citedreport_full_2.dta", replace
twoway hist totcite, frequency xtitle("Policy reports citations")
graph save graph00.gph, replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A3.eps", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A3.tif", replace


*Figure A4: Citations over time 
use "citedreport_full_2.dta", replace
collapse (mean) totcite, by(com_yearsubmiss)
graph twoway  ///
(scatter totcite com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcite com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("B: Policy advisory reports") ///
ytitle("Number of commission citations")  ylab(0(1)6, nogrid) scheme(plotplain) xlab(1970(8)2018,nogrid)
graph save g1.gph, replace

use "citedreports_nou_stm_1998.dta", replace
collapse (mean) stm_cit, by(com_yearsubmiss)
graph twoway  ///
(scatter stm_cit com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess stm_cit com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("A: White papers") ///
ytitle("Number of commission citations")  ylab(0(1)6, nogrid) scheme(plotplain) xlab(1998(4)2018,nogrid)
graph save g2.gph, replace

graph combine g2.gph g1.gph
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A4.eps", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_A4.tif", replace




* FIGURE A5 and FIGURE A6: Correlations between DVs. Number of citations (A5) and correlations (A6)
use "citedreports_nou_stm_1998.dta", replace
sort com_yearsubmiss
egen corr = corr(totcite stm_cit) , by(com_yearsubmiss)

graph twoway  ///
(scatter totcite stm_cit, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcite stm_cit, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Commissions" 2 "Trend line")) ///
xtitle("Citations in white papers", size(small)) /// 
title("") ///
ytitle("Citations in commission reports", size(small)) ylab(, nogrid) scheme(plotplain) xlab(,nogrid)
graph save graph0.gph, replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_a5.tif", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_a5.eps", replace

graph twoway  ///
(scatter corr com_yearsubmiss if com_yearsubmiss!=2017, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess corr com_yearsubmiss if com_yearsubmiss!=2017, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("") ///
ytitle("Pearsons r")  ylab(0(.2)1, nogrid) scheme(plotplain) xlab(1998(2)2018,nogrid)
graph save graph1.gph, replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_a6.tif", replace
graph export "~\citation analysis\Figures and tables\finalsub\appendix_a6.eps", replace



* FIGURE A7: Ministries
use "citedreport_full_2.dta", replace

* Policy reports
*Finans
use "citedreport_full_2.dta", replace
gen totcite_x = totcite if fin==1
keep if fin==1
replace com_yearsubmiss=. if com_yearsubmiss>2016
collapse (mean) totcite_x, by(com_yearsubmiss)
graph twoway  ///
(scatter totcite_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcite_x com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("A: Ministry of Finance") ///
ytitle("Citations in policy reports") ylab(0(1)10, nogrid) scheme(plotplain) xlab(1970(8)2018,nogrid)
graph save graph4.gph, replace

*Andre
use "citedreport_full_2.dta", replace
gen min=1
replace min=. if fin==1
tab min
gen totcite_x = totcite if min==1
replace com_yearsubmiss=. if com_yearsubmiss>2016
keep if min==1
collapse (mean) totcite_x, by(com_yearsubmiss)
graph twoway  ///
(scatter totcite_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcite_x com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("B: Other ministries") ///
ytitle("Citations in policy reports") ylab(0(1)10, nogrid) scheme(plotplain) xlab(1970(8)2018,nogrid)
graph save graph6.gph, replace

*Stortingsmeldinger
use "citedreports_nou_stm_1998.dta", replace
*Finans
use "citedreports_nou_stm_1998.dta", replace
gen stm_cit_x = stm_cit if fin==1
keep if fin==1
replace com_yearsubmiss=. if com_yearsubmiss>2016
collapse (mean) stm_cit_x, by(com_yearsubmiss)
graph twoway  ///
(scatter stm_cit_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess stm_cit_x com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("C: Ministry of Finance") ///
ytitle("Citations in white papers") ylab(0(1)10, nogrid) scheme(plotplain)  xlab(1998(5)2018,nogrid)
graph save graph4stm.gph, replace
*Andre
use "citedreports_nou_stm_1998.dta", replace
gen min=1
replace min=. if fin==1
tab min
gen stm_cit_x = stm_cit if min==1
replace com_yearsubmiss=. if com_yearsubmiss>2016
keep if min==1
collapse (mean) stm_cit_x, by(com_yearsubmiss)
graph twoway  ///
(scatter stm_cit_x com_yearsubmiss, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess stm_cit_x com_yearsubmiss, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Annual average" 2 "Trend line")) ///
xtitle("") /// 
title("D: Other ministries") ///
ytitle("Citations in white papers") ylab(0(1)10, nogrid) scheme(plotplain)  xlab(1998(5)2018,nogrid)
graph save graph6stm.gph, replace

*Combine
graph combine graph4.gph graph6.gph graph4stm.gph graph6stm.gph, row(2)
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a7.tif", replace
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a7.eps", replace




* FIGURE A8 and A9. Descriptive figures on resources and citations 
use "citedreports_nou_stm_1998.dta", replace

collapse date_count stm_cit totcit num_sec, by(NOU_ID)

graph twoway  ///
(scatter stm_cit num_sec, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess stm_cit num_sec, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Number of secretaries per commission" 2 "Trend line")) ///
xtitle("") /// 
title("A: White papers") ///
ytitle("Citations") ylab(, nogrid) scheme(plotplain) xlab(,nogrid)
graph save graph7stm.gph, replace

graph twoway  ///
(scatter totcit num_sec, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcit num_sec, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Number of secretaries per commission" 2 "Trend line")) ///
xtitle("") /// 
title("B: Policy advisory reports") ///
ytitle("Citations") ylab(, nogrid) scheme(plotplain) xlab(,nogrid)
graph save graph7.gph, replace


graph twoway  ///
(scatter totcit date_count, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess totcit date_count, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Time (years)" 2 "Trend line")) ///
xtitle("") /// 
title("B: Policy advisory reports") ///
ytitle("Citations") ylab(, nogrid) scheme(plotplain) xlab(,nogrid)
graph save graph8a.gph, replace


graph twoway  ///
(scatter stm_cit date_count, msymbol(circle) mlcolor(none) mcolor(gs8%50)) ///
(lowess stm_cit date_count, lpattern(solid) lcolor(black)), ///
legend(pos(6) row(1) order(1 "Time (years)" 2 "Trend line")) ///
xtitle("") /// 
title("A: White papers") ///
ytitle("Citations") ylab(, nogrid) scheme(plotplain) xlab(,nogrid)
graph save graph8b.gph, replace


graph combine graph7stm.gph graph7.gph
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a8.tif", replace
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a8.eps", replace

graph combine graph8b.gph graph8a.gph
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a9.tif", replace
graph export  "~\citation analysis\Figures and tables\finalsub\appendix_a9.eps", replace








